//
//  WaitPayTableViewController.m
//  GoodWayClient
//
//  Created by HuiDong on 15/12/8.
//  Copyright © 2015年 HuiDong. All rights reserved.
//

#import "WaitPayTableViewController.h"
#import "WaitPayTableViewCell.h"
#import "ShopOrderInfoTableViewController.h"

@interface WaitPayTableViewController ()<gotoPayDelegate>

@property (nonatomic, strong)NSArray *array;

- (IBAction)back:(id)sender;
@end

@implementation WaitPayTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

//懒加载
-(NSArray *)array
{
    if (!_array) {
        _array = @[@{@"ordernumber":@"12334875456",@"time":@"2015-11-13",@"image":@"logo",@"discri":@"123uhjnmv kclljv nm./Zcx ,",@"money":@"15"},@{@"ordernumber":@"12334875456",@"time":@"2015-11-13",@"image":@"logo",@"discri":@"123uhjnmv kclljv nm./Zcx ,",@"money":@"15"},@{@"ordernumber":@"12334875456",@"time":@"2015-11-13",@"image":@"logo",@"discri":@"123uhjnmv kclljv nm./Zcx ,",@"money":@"15"},@{@"ordernumber":@"12334875456",@"time":@"2015-11-13",@"image":@"logo",@"discri":@"123uhjnmv kclljv nm./Zcx ,",@"money":@"15"}];
    }
    return _array;
}

- (IBAction)back:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}


//数据源方法
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.array.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    WaitPayTableViewCell *cell = [WaitPayTableViewCell WaitPayWithTableView:tableView];
    cell.delegate = self;
    cell.dic = self.array[indexPath.row];
    return cell;
}

//设置行高
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 150;
}

//隐藏状态栏
-(BOOL)prefersStatusBarHidden
{
    return YES;
}

//代理的方法
- (void)goPay
{
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    ShopOrderInfoTableViewController *shopOrderInfo = [storyboard instantiateViewControllerWithIdentifier:@"ShopOrderInfoTableViewController"];
    [self presentViewController:shopOrderInfo animated:YES completion:nil];
}


@end
